<template>
    <div class="ele-body">
        <el-card>
            <Search @search="search" />
            <div class="title">单日数据概况</div>
            <div class="">
                <el-descriptions title="" direction="vertical" :column="4" border style="width: 70%;padding: 20px 0;"
                    v-loading="loading">
                    <el-descriptions-item label="游戏用户" labelClassName="my-label">{{ dayData.count ? dayData.count : 0
                        }}</el-descriptions-item>
                    <el-descriptions-item label="总投入">{{ dayData.totalBet ? dayData.totalBet : 0
                        }}</el-descriptions-item>
                    <el-descriptions-item label="总返还">{{ dayData.totalWin ? dayData.totalWin : 0
                        }}</el-descriptions-item>
                    <el-descriptions-item label="总利润">{{ dayData.profit ? dayData.profit : 0 }}</el-descriptions-item>

                    <el-descriptions-item label="slots用户">{{ dayData.slotsCount ? dayData.slotsCount : 0
                        }}</el-descriptions-item>
                    <el-descriptions-item label="slots投入">{{ dayData.slotsBet ? dayData.slotsBet : 0
                        }}</el-descriptions-item>
                    <el-descriptions-item label="slots返还">{{ dayData.slotsWin ? dayData.slotsWin : 0
                        }}</el-descriptions-item>
                    <el-descriptions-item label="slots利润">{{ dayData.slotsProfit ? dayData.slotsProfit : 0
                        }}</el-descriptions-item>

                    <el-descriptions-item label="真人用户">{{ dayData.zrCount ? dayData.zrCount : 0
                        }}</el-descriptions-item>
                    <el-descriptions-item label="真人投入">{{ dayData.zrBet ? dayData.zrBet : 0 }}</el-descriptions-item>
                    <el-descriptions-item label="真人返还">{{ dayData.zrWin ? dayData.zrWin : 0 }}</el-descriptions-item>
                    <el-descriptions-item label="真人利润">{{ dayData.zrProfit ? dayData.zrProfit : 0
                        }}</el-descriptions-item>

                    <el-descriptions-item label="棋牌用户">{{ dayData.qpCount ? dayData.qpCount : 0
                        }}</el-descriptions-item>
                    <el-descriptions-item label="棋牌投入">{{ dayData.qpBet ? dayData.qplBet : 0 }}</el-descriptions-item>
                    <el-descriptions-item label="棋牌返还">{{ dayData.qpWin ? dayData.qpWin : 0 }}</el-descriptions-item>
                    <el-descriptions-item label="棋牌利润">{{ dayData.qpProfit ? dayData.qpProfit : 0
                        }}</el-descriptions-item>

                    <el-descriptions-item label="彩票用户">{{ dayData.cpCount ? dayData.cpCount : 0
                        }}</el-descriptions-item>
                    <el-descriptions-item label="彩票投入">{{ dayData.cpBet ? dayData.cpBet : 0 }}</el-descriptions-item>
                    <el-descriptions-item label="彩票返还">{{ dayData.cpWin ? dayData.cpWin : 0 }}</el-descriptions-item>
                    <el-descriptions-item label="彩票利润">{{ dayData.cpProfit ? dayData.cpProfit : 0
                        }}</el-descriptions-item>
                </el-descriptions>
            </div>
            <div class="title">累计数据</div>
            <div class="">
                <el-descriptions title="" direction="vertical" :column="4" border style="width: 70%;padding: 20px 0;">
                    <el-descriptions-item label="游戏用户">{{ totalData.count ? totalData.count : 0
                        }}</el-descriptions-item>
                    <el-descriptions-item label="总投入">{{ totalData.totalBet ? totalData.totalBet : 0
                        }}</el-descriptions-item>
                    <el-descriptions-item label="总返还">{{ totalData.totalWin ? totalData.totalWin : 0
                        }}</el-descriptions-item>
                    <el-descriptions-item label="总利润">{{ totalData.profit ? totalData.profit : 0
                        }}</el-descriptions-item>

                    <el-descriptions-item label="slots用户">{{ totalData.slotsCount ? totalData.slotsCount : 0
                        }}</el-descriptions-item>
                    <el-descriptions-item label="slots投入">{{ totalData.slotsBet ? totalData.slotsBet : 0
                        }}</el-descriptions-item>
                    <el-descriptions-item label="slots返还">{{ totalData.slotsWin ? totalData.slotsWin : 0
                        }}</el-descriptions-item>
                    <el-descriptions-item label="slots利润">{{ totalData.slotsProfit ? totalData.slotsProfit : 0
                        }}</el-descriptions-item>

                    <el-descriptions-item label="体育用户">{{ totalData.tyCount ? totalData.tyCount : 0
                        }}</el-descriptions-item>
                    <el-descriptions-item label="体育投入">{{ totalData.tyBet ? totalData.tyBet : 0
                        }}</el-descriptions-item>
                    <el-descriptions-item label="体育返还">{{ totalData.tyWin ? totalData.tyWin : 0
                        }}</el-descriptions-item>
                    <el-descriptions-item label="体育利润">{{ totalData.tyProfit ? totalData.tyProfit : 0
                        }}</el-descriptions-item>

                    <el-descriptions-item label="真人用户">{{ totalData.zrCount ? totalData.zrCount : 0
                        }}</el-descriptions-item>
                    <el-descriptions-item label="真人投入">{{ totalData.zrBet ? totalData.zrBet : 0
                        }}</el-descriptions-item>
                    <el-descriptions-item label="真人返还">{{ totalData.zrWin ? totalData.zrWin : 0
                        }}</el-descriptions-item>
                    <el-descriptions-item label="真人利润">{{ totalData.zrProfit ? totalData.zrProfit : 0
                        }}</el-descriptions-item>

                    <el-descriptions-item label="棋牌用户">{{ totalData.qpCount ? totalData.qpCount : 0
                        }}</el-descriptions-item>
                    <el-descriptions-item label="棋牌投入">{{ totalData.qpBet ? totalData.qplBet : 0
                        }}</el-descriptions-item>
                    <el-descriptions-item label="棋牌返还">{{ totalData.qpWin ? totalData.qpWin : 0
                        }}</el-descriptions-item>
                    <el-descriptions-item label="棋牌利润">{{ totalData.qpProfit ? totalData.qpProfit : 0
                        }}</el-descriptions-item>

                    <el-descriptions-item label="彩票用户">{{ totalData.cpCount ? totalData.cpCount : 0
                        }}</el-descriptions-item>
                    <el-descriptions-item label="彩票投入">{{ totalData.cpBet ? totalData.cpBet : 0
                        }}</el-descriptions-item>
                    <el-descriptions-item label="彩票返还">{{ totalData.cpWin ? totalData.cpWin : 0
                        }}</el-descriptions-item>
                    <el-descriptions-item label="彩票利润">{{ totalData.cpProfit ? totalData.cpProfit : 0
                        }}</el-descriptions-item>
                </el-descriptions>
            </div>
        </el-card>
    </div>
</template>

<script>
import { pageGameLogDay, pageAllGameLog } from '@/api/gameData'
import Search from './components/search.vue'
export default {
    components: { Search },
    data() {
        return {
            dayData: {},
            totalData: {},
            loading: false,
        }
    },
    mounted() {
        this.getData();
        this.getData2();

    },
    methods: {
        search(val) {
            this.getData(val)
        },
        getData(val) {
            this.loading = true;
            pageGameLogDay(val).then(res => {
                if (res.status == 0) {
                    this.dayData = res.data;
                    // this.loading = false;
                }
            }).finally(() => {
                this.loading = false;
            })
        },
        getData2() {
            pageAllGameLog().then(res => {
                if (res.status == 0) {
                    this.totalData = res.data;
                }
            })
        },
    }

}
</script>

<style lang="scss" scoped>
.title {
    font-size: 20px;
    font-weight: bold;
}
::v-deep .el-descriptions-item__cell.el-descriptions-item__label.is-bordered-label {
    font-weight: bold !important;
    color: #606266 !important;
    text-align: center;
}
::v-deep .el-descriptions-item__cell.el-descriptions-item__content {
    font-weight: bold !important;
    color: #606266 !important;
    text-align: center;
}
</style>